package com.sword.test.testcase.demo;

import com.sword.test.testcase.TestCase;
import com.sword.woodpecker.autotest.framework.assertion.Validate;
import org.testng.Assert;
import org.testng.annotations.Test;


/**
 * 类描述:〈断言失败，是否中断流程相关用例〉
 *
 * @author: xujinjian
 */
public class Demo1TC extends TestCase {

    @Test(description = "断言失败，不中断流程")
    public void test1() {
        int a = 1;
        int b = 2;
        //校验a和b是否相等
        Validate.isEquals(a, b, "a和b相等");
        //继续运行后续代码
        logger.info("a=[{}]  b=[{}]", a, b);
        logger.info("a == b ? [{}]", a == b);
    }


    @Test(description = "断言失败，结束流程")
    public void test2() {
        int a = 1;
        int b = 2;
        //校验a和b是否相等
        Assert.assertTrue(a == b, "a和b相等");
        //不会运行后续代码
        logger.info("a=[{}]  b=[{}]", a, b);
        logger.info("a == b ? [{}]", a == b);
    }


}
